package edu.gyc.homework;

import java.util.Objects;

public class Tank {
    private int gunCaliber;
    private int total;
    private String color;

    public Tank() {
        this.gunCaliber=105;
        this.total=40;
        this.color = "Green";
    }

    public Tank(int gunCaliber, int total, String color) {
        this.gunCaliber = gunCaliber;
        this.total = total;
        this.color = color;
    }

    public int getGunCaliber() {
        return gunCaliber;
    }

    public void setGunCaliber(int gunCaliber) {
        this.gunCaliber = gunCaliber;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "Tank{" +
                "gunCaliber=" + gunCaliber +
                ", total=" + total +
                ", color='" + color + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        Tank tank = (Tank) o;
        return gunCaliber == tank.gunCaliber &&
                total == tank.total;
    }

    public static void main(String[] args) {
        Tank M60 = new Tank();
        Tank China99A = new Tank(125,60,"沙漠迷彩");
        System.out.println(M60);
        System.out.println(China99A);
        System.out.println(China99A.equals(M60));
    }
}
